﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// abstract OrganizacijskaJedinica typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class OrganizacijskaJedinicaDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<OrganizacijskaJedinicaDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.OrganizacijskaJedinica _currentOrganizacijskaJedinica = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxOrganizacijskaJedinicaDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxOrganizacijskaJedinicaErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxOrganizacijskaJedinicaBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ID property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxIDDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Naziv property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxNazivDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the SkraceniNaziv property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxSkraceniNazivDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Poreznibroj property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxPoreznibrojDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the MaticniBrojSubjekta property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxMaticniBrojSubjektaDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDRoditelj property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDRoditeljDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Hierarchy property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxHierarchyDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Lvl property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxLvlDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDOrganizacijskaJedinicaTip property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDOrganizacijskaJedinicaTipDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Sifra property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxSifraDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Grupa property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxGrupaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Telefon property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxTelefonDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Fax property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxFaxDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Adresa property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxAdresaDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the EMail property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxEMailDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the IDMjesto property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxIDMjestoDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Direktor property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDirektorDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the CalculatedHierarchy property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxCalculatedHierarchyDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DefaultVrstaObveznikaRSM property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDefaultVrstaObveznikaRSMDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DefaultVrijednostDoprinosaZaBoravakUInozemstvu property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the OIB property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxOIBDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.Mjesto> _IDMjestoList;
		
		/// <summary> 
		/// The list of selectable Mjesto
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.Mjesto> IDMjestoList
		{
			get {return this._IDMjestoList;}
			set 
			{
				this._IDMjestoList = value;
				this.uxIDMjestoDataGridViewColumn.DataSource = null;
				this.uxIDMjestoDataGridViewColumn.DataSource = this._IDMjestoList;
			}
		}
		
		private bool _allowNewItemInIDMjestoList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of Mjesto
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDMjestoList
		{
			get { return _allowNewItemInIDMjestoList;}
			set
			{
				this._allowNewItemInIDMjestoList = value;
				this.uxIDMjestoDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.OrganizacijskaJedinica> _IDRoditeljList;
		
		/// <summary> 
		/// The list of selectable OrganizacijskaJedinica
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.OrganizacijskaJedinica> IDRoditeljList
		{
			get {return this._IDRoditeljList;}
			set 
			{
				this._IDRoditeljList = value;
				this.uxIDRoditeljDataGridViewColumn.DataSource = null;
				this.uxIDRoditeljDataGridViewColumn.DataSource = this._IDRoditeljList;
			}
		}
		
		private bool _allowNewItemInIDRoditeljList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of OrganizacijskaJedinica
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDRoditeljList
		{
			get { return _allowNewItemInIDRoditeljList;}
			set
			{
				this._allowNewItemInIDRoditeljList = value;
				this.uxIDRoditeljDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.OrganizacijskaJedinicaTip> _IDOrganizacijskaJedinicaTipList;
		
		/// <summary> 
		/// The list of selectable OrganizacijskaJedinicaTip
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.OrganizacijskaJedinicaTip> IDOrganizacijskaJedinicaTipList
		{
			get {return this._IDOrganizacijskaJedinicaTipList;}
			set 
			{
				this._IDOrganizacijskaJedinicaTipList = value;
				this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn.DataSource = null;
				this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn.DataSource = this._IDOrganizacijskaJedinicaTipList;
			}
		}
		
		private bool _allowNewItemInIDOrganizacijskaJedinicaTipList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of OrganizacijskaJedinicaTip
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDOrganizacijskaJedinicaTipList
		{
			get { return _allowNewItemInIDOrganizacijskaJedinicaTipList;}
			set
			{
				this._allowNewItemInIDOrganizacijskaJedinicaTipList = value;
				this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.OrganizacijskaJedinica> _OrganizacijskaJedinicaList;
				
		/// <summary> 
		/// The list of OrganizacijskaJedinica to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.OrganizacijskaJedinica> OrganizacijskaJedinicaList
		{
			get {return this._OrganizacijskaJedinicaList;}
			set
			{
				this._OrganizacijskaJedinicaList = value;
				this.uxOrganizacijskaJedinicaBindingSource.DataSource = null;
				this.uxOrganizacijskaJedinicaBindingSource.DataSource = value;
				this.uxOrganizacijskaJedinicaDataGridView.DataSource = null;
				this.uxOrganizacijskaJedinicaDataGridView.DataSource = this.uxOrganizacijskaJedinicaBindingSource;				
				//this.uxOrganizacijskaJedinicaBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxOrganizacijskaJedinicaBindingSource_ListChanged);
				this.uxOrganizacijskaJedinicaBindingSource.CurrentItemChanged += new System.EventHandler(OnOrganizacijskaJedinicaBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnOrganizacijskaJedinicaBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentOrganizacijskaJedinica = uxOrganizacijskaJedinicaBindingSource.Current as Entities.OrganizacijskaJedinica;
			
			if (_currentOrganizacijskaJedinica != null)
			{
				_currentOrganizacijskaJedinica.Validate();
			}
			//_OrganizacijskaJedinica.Validate();
			OnCurrentEntityChanged();
		}

		//void uxOrganizacijskaJedinicaBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.OrganizacijskaJedinica"/> instance.
		/// </summary>
		public Entities.OrganizacijskaJedinica SelectedOrganizacijskaJedinica
		{
			get {return this._currentOrganizacijskaJedinica;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxOrganizacijskaJedinicaDataGridView.VirtualMode;}
			set
			{
				this.uxOrganizacijskaJedinicaDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxOrganizacijskaJedinicaDataGridView.AllowUserToAddRows;}
			set {this.uxOrganizacijskaJedinicaDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxOrganizacijskaJedinicaDataGridView.AllowUserToDeleteRows;}
			set {this.uxOrganizacijskaJedinicaDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxOrganizacijskaJedinicaDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxOrganizacijskaJedinicaDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="OrganizacijskaJedinicaDataGridViewBase"/> class.
		/// </summary>
		public OrganizacijskaJedinicaDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxOrganizacijskaJedinicaDataGridView = new System.Windows.Forms.DataGridView();
			this.uxOrganizacijskaJedinicaBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxOrganizacijskaJedinicaErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxIDDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNazivDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxSkraceniNazivDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxPoreznibrojDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxMaticniBrojSubjektaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDRoditeljDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxHierarchyDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxLvlDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxSifraDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxGrupaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxTelefonDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxFaxDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxAdresaDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxEMailDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxIDMjestoDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxDirektorDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxCalculatedHierarchyDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDefaultVrstaObveznikaRSMDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxOIBDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxIDMjestoBindingSource = new MjestoBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDMjestoBindingSource)).BeginInit();
			//this.uxIDRoditeljBindingSource = new OrganizacijskaJedinicaBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDRoditeljBindingSource)).BeginInit();
			//this.uxIDOrganizacijskaJedinicaTipBindingSource = new OrganizacijskaJedinicaTipBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOrganizacijskaJedinicaTipBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOrganizacijskaJedinicaDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOrganizacijskaJedinicaBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOrganizacijskaJedinicaErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxOrganizacijskaJedinicaErrorProvider
			// 
			this.uxOrganizacijskaJedinicaErrorProvider.ContainerControl = this;
			this.uxOrganizacijskaJedinicaErrorProvider.DataSource = this.uxOrganizacijskaJedinicaBindingSource;						
			// 
			// uxOrganizacijskaJedinicaDataGridView
			// 
			this.uxOrganizacijskaJedinicaDataGridView.AutoGenerateColumns = false;
			this.uxOrganizacijskaJedinicaDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxOrganizacijskaJedinicaDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxIDDataGridViewColumn,
		this.uxNazivDataGridViewColumn,
		this.uxSkraceniNazivDataGridViewColumn,
		this.uxPoreznibrojDataGridViewColumn,
		this.uxMaticniBrojSubjektaDataGridViewColumn,
		this.uxIDRoditeljDataGridViewColumn,
		this.uxHierarchyDataGridViewColumn,
		this.uxLvlDataGridViewColumn,
		this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn,
		this.uxSifraDataGridViewColumn,
		this.uxGrupaDataGridViewColumn,
		this.uxTelefonDataGridViewColumn,
		this.uxFaxDataGridViewColumn,
		this.uxAdresaDataGridViewColumn,
		this.uxEMailDataGridViewColumn,
		this.uxIDMjestoDataGridViewColumn,
		this.uxDirektorDataGridViewColumn,
		this.uxCalculatedHierarchyDataGridViewColumn,
		this.uxDefaultVrstaObveznikaRSMDataGridViewColumn,
		this.uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn,
		this.uxOIBDataGridViewColumn			});
			this.uxOrganizacijskaJedinicaDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxOrganizacijskaJedinicaDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxOrganizacijskaJedinicaDataGridView.Name = "uxOrganizacijskaJedinicaDataGridView";
			this.uxOrganizacijskaJedinicaDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxOrganizacijskaJedinicaDataGridView.TabIndex = 0;	
			this.uxOrganizacijskaJedinicaDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxOrganizacijskaJedinicaDataGridView.EnableHeadersVisualStyles = false;
			this.uxOrganizacijskaJedinicaDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnOrganizacijskaJedinicaDataGridViewDataError);
			this.uxOrganizacijskaJedinicaDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOrganizacijskaJedinicaDataGridViewCellValueNeeded);
			this.uxOrganizacijskaJedinicaDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnOrganizacijskaJedinicaDataGridViewCellValuePushed);
			
			//
			// uxIDDataGridViewColumn
			//
			this.uxIDDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDDataGridViewColumn.DataPropertyName = "ID";
			this.uxIDDataGridViewColumn.HeaderText = "ID";
			this.uxIDDataGridViewColumn.Name = "uxIDDataGridViewColumn";
			this.uxIDDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDDataGridViewColumn.ReadOnly = true;		
			//
			// uxNazivDataGridViewColumn
			//
			this.uxNazivDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNazivDataGridViewColumn.DataPropertyName = "Naziv";
			this.uxNazivDataGridViewColumn.HeaderText = "Naziv";
			this.uxNazivDataGridViewColumn.Name = "uxNazivDataGridViewColumn";
			this.uxNazivDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNazivDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNazivDataGridViewColumn.ReadOnly = false;		
			//
			// uxSkraceniNazivDataGridViewColumn
			//
			this.uxSkraceniNazivDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxSkraceniNazivDataGridViewColumn.DataPropertyName = "SkraceniNaziv";
			this.uxSkraceniNazivDataGridViewColumn.HeaderText = "SkraceniNaziv";
			this.uxSkraceniNazivDataGridViewColumn.Name = "uxSkraceniNazivDataGridViewColumn";
			this.uxSkraceniNazivDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxSkraceniNazivDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxSkraceniNazivDataGridViewColumn.ReadOnly = false;		
			//
			// uxPoreznibrojDataGridViewColumn
			//
			this.uxPoreznibrojDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxPoreznibrojDataGridViewColumn.DataPropertyName = "Poreznibroj";
			this.uxPoreznibrojDataGridViewColumn.HeaderText = "Poreznibroj";
			this.uxPoreznibrojDataGridViewColumn.Name = "uxPoreznibrojDataGridViewColumn";
			this.uxPoreznibrojDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxPoreznibrojDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxPoreznibrojDataGridViewColumn.ReadOnly = false;		
			//
			// uxMaticniBrojSubjektaDataGridViewColumn
			//
			this.uxMaticniBrojSubjektaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxMaticniBrojSubjektaDataGridViewColumn.DataPropertyName = "MaticniBrojSubjekta";
			this.uxMaticniBrojSubjektaDataGridViewColumn.HeaderText = "MaticniBrojSubjekta";
			this.uxMaticniBrojSubjektaDataGridViewColumn.Name = "uxMaticniBrojSubjektaDataGridViewColumn";
			this.uxMaticniBrojSubjektaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxMaticniBrojSubjektaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxMaticniBrojSubjektaDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDRoditeljDataGridViewColumn
			//
			this.uxIDRoditeljDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDRoditeljDataGridViewColumn.DataPropertyName = "IDRoditelj";
			this.uxIDRoditeljDataGridViewColumn.HeaderText = "IDRoditelj";
			this.uxIDRoditeljDataGridViewColumn.Name = "uxIDRoditeljDataGridViewColumn";
			this.uxIDRoditeljDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDRoditeljDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDRoditeljDataGridViewColumn.ReadOnly = false;		
			//
			// uxHierarchyDataGridViewColumn
			//
			this.uxHierarchyDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxHierarchyDataGridViewColumn.DataPropertyName = "Hierarchy";
			this.uxHierarchyDataGridViewColumn.HeaderText = "Hierarchy";
			this.uxHierarchyDataGridViewColumn.Name = "uxHierarchyDataGridViewColumn";
			this.uxHierarchyDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxHierarchyDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxHierarchyDataGridViewColumn.ReadOnly = false;		
			//
			// uxLvlDataGridViewColumn
			//
			this.uxLvlDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxLvlDataGridViewColumn.DataPropertyName = "Lvl";
			this.uxLvlDataGridViewColumn.HeaderText = "Lvl";
			this.uxLvlDataGridViewColumn.Name = "uxLvlDataGridViewColumn";
			this.uxLvlDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxLvlDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxLvlDataGridViewColumn.ReadOnly = true;		
			//
			// uxIDOrganizacijskaJedinicaTipDataGridViewColumn
			//
			this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn.DataPropertyName = "IDOrganizacijskaJedinicaTip";
			this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn.HeaderText = "IDOrganizacijskaJedinicaTip";
			this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn.Name = "uxIDOrganizacijskaJedinicaTipDataGridViewColumn";
			this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn.ReadOnly = false;		
			//
			// uxSifraDataGridViewColumn
			//
			this.uxSifraDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxSifraDataGridViewColumn.DataPropertyName = "Sifra";
			this.uxSifraDataGridViewColumn.HeaderText = "Sifra";
			this.uxSifraDataGridViewColumn.Name = "uxSifraDataGridViewColumn";
			this.uxSifraDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxSifraDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxSifraDataGridViewColumn.ReadOnly = false;		
			//
			// uxGrupaDataGridViewColumn
			//
			this.uxGrupaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxGrupaDataGridViewColumn.DataPropertyName = "Grupa";
			this.uxGrupaDataGridViewColumn.HeaderText = "Grupa";
			this.uxGrupaDataGridViewColumn.Name = "uxGrupaDataGridViewColumn";
			this.uxGrupaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxGrupaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxGrupaDataGridViewColumn.ReadOnly = false;		
			//
			// uxTelefonDataGridViewColumn
			//
			this.uxTelefonDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxTelefonDataGridViewColumn.DataPropertyName = "Telefon";
			this.uxTelefonDataGridViewColumn.HeaderText = "Telefon";
			this.uxTelefonDataGridViewColumn.Name = "uxTelefonDataGridViewColumn";
			this.uxTelefonDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxTelefonDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxTelefonDataGridViewColumn.ReadOnly = false;		
			//
			// uxFaxDataGridViewColumn
			//
			this.uxFaxDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxFaxDataGridViewColumn.DataPropertyName = "Fax";
			this.uxFaxDataGridViewColumn.HeaderText = "Fax";
			this.uxFaxDataGridViewColumn.Name = "uxFaxDataGridViewColumn";
			this.uxFaxDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxFaxDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxFaxDataGridViewColumn.ReadOnly = false;		
			//
			// uxAdresaDataGridViewColumn
			//
			this.uxAdresaDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxAdresaDataGridViewColumn.DataPropertyName = "Adresa";
			this.uxAdresaDataGridViewColumn.HeaderText = "Adresa";
			this.uxAdresaDataGridViewColumn.Name = "uxAdresaDataGridViewColumn";
			this.uxAdresaDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxAdresaDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxAdresaDataGridViewColumn.ReadOnly = false;		
			//
			// uxEMailDataGridViewColumn
			//
			this.uxEMailDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxEMailDataGridViewColumn.DataPropertyName = "EMail";
			this.uxEMailDataGridViewColumn.HeaderText = "EMail";
			this.uxEMailDataGridViewColumn.Name = "uxEMailDataGridViewColumn";
			this.uxEMailDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxEMailDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxEMailDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDMjestoDataGridViewColumn
			//
			this.uxIDMjestoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxIDMjestoDataGridViewColumn.DataPropertyName = "IDMjesto";
			this.uxIDMjestoDataGridViewColumn.HeaderText = "IDMjesto";
			this.uxIDMjestoDataGridViewColumn.Name = "uxIDMjestoDataGridViewColumn";
			this.uxIDMjestoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxIDMjestoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxIDMjestoDataGridViewColumn.ReadOnly = false;		
			//
			// uxDirektorDataGridViewColumn
			//
			this.uxDirektorDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDirektorDataGridViewColumn.DataPropertyName = "Direktor";
			this.uxDirektorDataGridViewColumn.HeaderText = "Direktor";
			this.uxDirektorDataGridViewColumn.Name = "uxDirektorDataGridViewColumn";
			this.uxDirektorDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDirektorDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDirektorDataGridViewColumn.ReadOnly = false;		
			//
			// uxCalculatedHierarchyDataGridViewColumn
			//
			this.uxCalculatedHierarchyDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxCalculatedHierarchyDataGridViewColumn.DataPropertyName = "CalculatedHierarchy";
			this.uxCalculatedHierarchyDataGridViewColumn.HeaderText = "CalculatedHierarchy";
			this.uxCalculatedHierarchyDataGridViewColumn.Name = "uxCalculatedHierarchyDataGridViewColumn";
			this.uxCalculatedHierarchyDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxCalculatedHierarchyDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxCalculatedHierarchyDataGridViewColumn.ReadOnly = true;		
			//
			// uxDefaultVrstaObveznikaRSMDataGridViewColumn
			//
			this.uxDefaultVrstaObveznikaRSMDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDefaultVrstaObveznikaRSMDataGridViewColumn.DataPropertyName = "DefaultVrstaObveznikaRSM";
			this.uxDefaultVrstaObveznikaRSMDataGridViewColumn.HeaderText = "DefaultVrstaObveznikaRSM";
			this.uxDefaultVrstaObveznikaRSMDataGridViewColumn.Name = "uxDefaultVrstaObveznikaRSMDataGridViewColumn";
			this.uxDefaultVrstaObveznikaRSMDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDefaultVrstaObveznikaRSMDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDefaultVrstaObveznikaRSMDataGridViewColumn.ReadOnly = false;		
			//
			// uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn
			//
			this.uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn.DataPropertyName = "DefaultVrijednostDoprinosaZaBoravakUInozemstvu";
			this.uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn.HeaderText = "DefaultVrijednostDoprinosaZaBoravakUInozemstvu";
			this.uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn.Name = "uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn";
			this.uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn.ReadOnly = false;		
			//
			// uxOIBDataGridViewColumn
			//
			this.uxOIBDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxOIBDataGridViewColumn.DataPropertyName = "OIB";
			this.uxOIBDataGridViewColumn.HeaderText = "OIB";
			this.uxOIBDataGridViewColumn.Name = "uxOIBDataGridViewColumn";
			this.uxOIBDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxOIBDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxOIBDataGridViewColumn.ReadOnly = false;		
			//
			// uxIDMjestoDataGridViewColumn
			//				
			this.uxIDMjestoDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDMjestoDataGridViewColumn.ValueMember = "ID";	
			this.uxIDMjestoDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDMjestoDataGridViewColumn.DataSource = uxIDMjestoBindingSource;				
				
			//
			// uxIDRoditeljDataGridViewColumn
			//				
			this.uxIDRoditeljDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDRoditeljDataGridViewColumn.ValueMember = "ID";	
			this.uxIDRoditeljDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDRoditeljDataGridViewColumn.DataSource = uxIDRoditeljBindingSource;				
				
			//
			// uxIDOrganizacijskaJedinicaTipDataGridViewColumn
			//				
			this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn.DisplayMember = "Naziv";	
			this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn.ValueMember = "ID";	
			this.uxIDOrganizacijskaJedinicaTipDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxIDOrganizacijskaJedinicaTipDataGridViewColumn.DataSource = uxIDOrganizacijskaJedinicaTipBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxOrganizacijskaJedinicaDataGridView);
			this.Name = "OrganizacijskaJedinicaDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxIDMjestoBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDRoditeljBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxIDOrganizacijskaJedinicaTipBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOrganizacijskaJedinicaErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOrganizacijskaJedinicaDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxOrganizacijskaJedinicaBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				OrganizacijskaJedinicaDataGridViewEventArgs args = new OrganizacijskaJedinicaDataGridViewEventArgs();
				args.OrganizacijskaJedinica = _currentOrganizacijskaJedinica;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class OrganizacijskaJedinicaDataGridViewEventArgs : System.EventArgs
		{
			private Entities.OrganizacijskaJedinica	_OrganizacijskaJedinica;
	
			/// <summary>
			/// the  Entities.OrganizacijskaJedinica instance.
			/// </summary>
			public Entities.OrganizacijskaJedinica OrganizacijskaJedinica
			{
				get { return _OrganizacijskaJedinica; }
				set { _OrganizacijskaJedinica = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxOrganizacijskaJedinicaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnOrganizacijskaJedinicaDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxOrganizacijskaJedinicaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOrganizacijskaJedinicaDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOrganizacijskaJedinicaDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].ID;
						break;
					case "uxNazivDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].Naziv;
						break;
					case "uxSkraceniNazivDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].SkraceniNaziv;
						break;
					case "uxPoreznibrojDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].Poreznibroj;
						break;
					case "uxMaticniBrojSubjektaDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].MaticniBrojSubjekta;
						break;
					case "uxIDRoditeljDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].IDRoditelj;
						break;
					case "uxHierarchyDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].Hierarchy;
						break;
					case "uxLvlDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].Lvl;
						break;
					case "uxIDOrganizacijskaJedinicaTipDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].IDOrganizacijskaJedinicaTip;
						break;
					case "uxSifraDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].Sifra;
						break;
					case "uxGrupaDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].Grupa;
						break;
					case "uxTelefonDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].Telefon;
						break;
					case "uxFaxDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].Fax;
						break;
					case "uxAdresaDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].Adresa;
						break;
					case "uxEMailDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].EMail;
						break;
					case "uxIDMjestoDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].IDMjesto;
						break;
					case "uxDirektorDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].Direktor;
						break;
					case "uxCalculatedHierarchyDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].CalculatedHierarchy;
						break;
					case "uxDefaultVrstaObveznikaRSMDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].DefaultVrstaObveznikaRSM;
						break;
					case "uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].DefaultVrijednostDoprinosaZaBoravakUInozemstvu;
						break;
					case "uxOIBDataGridViewColumn":
						e.Value = OrganizacijskaJedinicaList[e.RowIndex].OIB;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxOrganizacijskaJedinicaDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnOrganizacijskaJedinicaDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxOrganizacijskaJedinicaDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxIDDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].ID = (System.Int32)e.Value;
						break;
					case "uxNazivDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].Naziv = (System.String)e.Value;
						break;
					case "uxSkraceniNazivDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].SkraceniNaziv = (System.String)e.Value;
						break;
					case "uxPoreznibrojDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].Poreznibroj = (System.String)e.Value;
						break;
					case "uxMaticniBrojSubjektaDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].MaticniBrojSubjekta = (System.String)e.Value;
						break;
					case "uxIDRoditeljDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].IDRoditelj = (System.Int32?)e.Value;
						break;
					case "uxHierarchyDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].Hierarchy = (System.String)e.Value;
						break;
					case "uxLvlDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].Lvl = (System.Int32?)e.Value;
						break;
					case "uxIDOrganizacijskaJedinicaTipDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].IDOrganizacijskaJedinicaTip = (System.Int32)e.Value;
						break;
					case "uxSifraDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].Sifra = (System.String)e.Value;
						break;
					case "uxGrupaDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].Grupa = (System.String)e.Value;
						break;
					case "uxTelefonDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].Telefon = (System.String)e.Value;
						break;
					case "uxFaxDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].Fax = (System.String)e.Value;
						break;
					case "uxAdresaDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].Adresa = (System.String)e.Value;
						break;
					case "uxEMailDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].EMail = (System.String)e.Value;
						break;
					case "uxIDMjestoDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].IDMjesto = (System.Int32?)e.Value;
						break;
					case "uxDirektorDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].Direktor = (System.String)e.Value;
						break;
					case "uxCalculatedHierarchyDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].CalculatedHierarchy = (System.String)e.Value;
						break;
					case "uxDefaultVrstaObveznikaRSMDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].DefaultVrstaObveznikaRSM = (System.Int32?)e.Value;
						break;
					case "uxDefaultVrijednostDoprinosaZaBoravakUInozemstvuDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].DefaultVrijednostDoprinosaZaBoravakUInozemstvu = (System.Decimal?)e.Value;
						break;
					case "uxOIBDataGridViewColumn":
						OrganizacijskaJedinicaList[e.RowIndex].OIB = (System.String)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
